# -*- mode: snippet -*-
# name: switch with stop (case-when match)
# key: switch.stop
# contributor : Shuguang Sun
# --
res <- switch(
  ${1:var-or-exp},
  "${2:cond1}" = ${3:expr1},
  "${4:cond2}" = ${5:expr2},
  stop("${6}", call. = FALSE)
)
$0